T
The query type
IdeaBlade DevForce 2010 Help Reference
EntityQueryPager<T> Class
Members  See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : EntityQueryPager<T> Class



A pager which allows EntityQuery<T> results to be paged either synchronously or asynchronously.

Object Model

EntityQueryPager<T> ClassISortSelector Interface

Syntax

Visual Basic (Declaration) 
Public Class EntityQueryPager(Of T) 
   Inherits EntityQueryPager
Visual Basic (Usage)Copy Code
Dim instance As EntityQueryPager(Of T)
C# 
public class EntityQueryPager<T> : EntityQueryPager 
C++/CLI 
generic<typename T>
public ref class EntityQueryPager : public EntityQueryPager 

Type Parameters

T
The query type

Remarks

Use the EntityQueryPager to manage paging of query results. The query can return items of an entity or anonymous type. When creating the EntityQueryPager the baseQuery determines the selection criteria, and also indicates the QueryStrategy in effect and the EntityManager used.

The QueryStrategy of the baseQuery controls whether paging is managed over just the local cache (QueryStrategy.CacheOnly), just the database (QueryStrategy.DataSourceOnly), or both ( QueryStrategy.DataSourceThenCache). Merge semantics are determined by the baseQuery.QueryStrategy.MergeStrategy.

No query is executed until the first MoveTo method is called. You'll usually call MoveToFirstPage or MoveToFirstPageAsync to get things started. You can then move forward and backward through query results using the MoveToNextPage and MoveToPreviousPage methods or their asynchronous counterparts. As paging is performed a query is executed for the specific "page" of the overall query results using the appropriate "skip" and "take" LINQ operators. MoveToLastPage allows you to go directly to the final page of results. The PageIndex and CurrentPageResults are used to indicate the current page and its data. When using the asynchronous API, query results are also returned in the PageChangedOperation<T>.

The EntityQueryPager<T>.PageChanging and EntityQueryPager<T>.PageChanged events are fired for all syncrhonous and asynchronous "MoveTo" calls.

An IdeaBlade.Core.ISortSelector is required to provide for ordered, and orderly, paging. Ideally the sort selector should guarantee that no two records have the same sort position, however the pager will still work with 'nonunique' sorts but performance will be improved the more unique the sort.

If the baseQuery's EntityManager is cleared then this will trigger a Reset call within this instance.

Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.EntityQueryPager
      IdeaBlade.EntityModel.EntityQueryPager<T>

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.